concord<-read.table("out_concordance",sep=" ")
dim(concord)
r2<-read.table("beagle_out_8.snps_chr8.bgl.gz.r2",sep="\t")
dim(r2)
concord[1,]
r2[1,]
which(r2[,2] != 'Nan')[1]
which(r2[,2] != 'NaN')[1]
r2<-r2[which(r2[,2] != 'NaN'),]
dim(r2)
colnames(r2)<-c("snp","r2")
colnames(concord)<-c("snp","concord")
merge<-merge(r2,concord,by="snp")
dim(merge)
plot("concordanceVSr2.pdf")
dev.off(0
dev.off()
pdf("concordanceVSr2.pdf")
merge[1,]
plot(merge$r2,merge$concord,xlab="Beagle R2",ylab = "Number of snps concordant",xlim=c(0,1),main="Number of snps Concordant VS Beagle R2")
dev.off()
cor(merge$r2,merge$concord,method="pearson")
pdf("concordanceVSr2.pdf")
plot(merge$r2,merge$concord,xlab="Beagle R2",ylab = "Number of snps concordant",xlim=c(0,1),main="Number of snps Concordant VS Beagle R2",pch='.')
dev.off()
pdf("concordanceVSr2.pdf")
plot(merge$r2,merge$concord,xlab="Beagle R2",ylab = "Number of samples concordant per marker",xlim=c(0,1),main="Concordance VS Beagle R2",pch='.')
dev.off()
pdf("histogram_concordance.pdf")
hist(merge$concord,breaks=seq(1,1400,10),xlab="Number of Samples",ylab ="Number of Markers",main="Number of samples concordant per marker")
dev.off()
savehistory("concord.R")
